#!/bin/bash

## change these to whatever you actually need
#command1="cd ~/TEB;source devel/setup.bash;roslaunch teb_local_planner_tutorials robot_carlike_in_stage.launch; bash"
#command2="sleep 2s;roslaunch yocs_velocity_smoother standalone.launch; bash"
#command3="sleep 3s;source ~/control/devel/setup.bash; roslaunch control control.launch; bash"
#command4="sleep 4s;source ~/ReedsShepp/devel/setup.bash; roslaunch steering_functions steering_functions.launch; bash"
command1="cd ./bin;./chat_server 127.0.0.1 6000;"
command2="cd ./bin:./ChatClient 127.0.0.1 6002"
command3="cd ./bin:./ChatClient 127.0.0.1 8000"
command3="cd ./bin:./ChatClient 127.0.0.1 8000"



## Modify terminator's config
sed -i.bak "s#COMMAND1#$command1#; s#COMMAND2#$command2#; s#COMMAND3#$command3#; s#COMMAND4#$command4#;" ~/.config/terminator/config

## Launch a terminator instance using the new layout
terminator -l default

## Return the original config file
mv ~/.config/terminator/config.bak ~/.config/terminator/config

